package org.krishna.model;



import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "BOOK_DETAILS")
public class BookDetails implements Serializable{
	
	/** The Constant serialVersionUID. */
	@Transient
	private static final long serialVersionUID = -7660824605183781430L;
	
	
	@Id
	@GeneratedValue
	@Column(name = "BOOK_ID")
	private long bookId;

	@Column(name = "BOOK_NAME")
	private String bookName;
	
	@Column(name = "AUTHOR")
	private String author;
	
	@Column(name = "ISBN_NO")
	private String isbnNo;
		
	@Column(name = "LOANED_DATE")
	private Date loanedDate;	
	
	@Column(name = "DUE_DATE")
	private Date dueDate;

	@ManyToOne
	@JoinColumn(name = "USER_ID")
	private UserDetails userDetails;
	
	@ManyToOne
	@JoinColumn(name = "STATUS")
	private Status status;
	
	@OneToMany(mappedBy = "bookDetails")
	private Set<Verification> verification;
	
	@OneToMany(mappedBy = "bookDetails")
	private Set<TransactionDetails> transactionDetails;

	/**
	 * @return the bookId
	 */
	public long getBookId() {
		return bookId;
	}

	/**
	 * @param bookId the bookId to set
	 */
	public void setBookId(long bookId) {
		this.bookId = bookId;
	}

	/**
	 * @return the bookName
	 */
	public String getBookName() {
		return bookName;
	}

	/**
	 * @param bookName the bookName to set
	 */
	public void setBookName(String bookName) {
		this.bookName = bookName;
	}

	/**
	 * @return the author
	 */
	public String getAuthor() {
		return author;
	}

	/**
	 * @param author the author to set
	 */
	public void setAuthor(String author) {
		this.author = author;
	}

	/**
	 * @return the isbnNo
	 */
	public String getIsbnNo() {
		return isbnNo;
	}

	/**
	 * @param isbnNo the isbnNo to set
	 */
	public void setIsbnNo(String isbnNo) {
		this.isbnNo = isbnNo;
	}

	/**
	 * @return the loanedDate
	 */
	public Date getLoanedDate() {
		return loanedDate;
	}

	/**
	 * @param loanedDate the loanedDate to set
	 */
	public void setLoanedDate(Date loanedDate) {
		this.loanedDate = loanedDate;
	}

	/**
	 * @return the dueDate
	 */
	public Date getDueDate() {
		return dueDate;
	}

	/**
	 * @param dueDate the dueDate to set
	 */
	public void setDueDate(Date dueDate) {
		this.dueDate = dueDate;
	}

	/**
	 * @return the userDetails
	 */
	public UserDetails getUserDetails() {
		return userDetails;
	}

	/**
	 * @param userDetails the userDetails to set
	 */
	public void setUserDetails(UserDetails userDetails) {
		this.userDetails = userDetails;
	}

	/**
	 * @return the status
	 */
	public Status getStatus() {
		return status;
	}

	/**
	 * @param status the status to set
	 */
	public void setStatus(Status status) {
		this.status = status;
	}

	/**
	 * @return the verification
	 */
	public Set<Verification> getVerification() {
		return verification;
	}

	/**
	 * @param verification the verification to set
	 */
	public void setVerification(Set<Verification> verification) {
		this.verification = verification;
	}

	/**
	 * @return the transactionDetails
	 */
	public Set<TransactionDetails> getTransactionDetails() {
		return transactionDetails;
	}

	/**
	 * @param transactionDetails the transactionDetails to set
	 */
	public void setTransactionDetails(Set<TransactionDetails> transactionDetails) {
		this.transactionDetails = transactionDetails;
	}
}
